<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script src="../js/axios.js"></script>
		<script>
			
			let user={
				name:"colin",
				age:18,
				sex:"boy"
			}
			
			axios.get("http://localhost:8090/axios/User/getUserObj",
					{params:user})
			.then(function(result){
				console.log(result.data)
				console.log(result)
			})	
			
			let user1={
				name:"post请求语法",
				age:18,
				sex:"boy"
			}
			let url1 ="http://localhost:8090/axios/insertUser"
			axios.post(url1,user1)
			.then(function(result){
				console.log(result.data)
				console.log(result)
			})	
			let url2="http://localhost:8090/axios/user/redis/18/男"
			axios.post(url2)
			.then(function(result){
				console.log(result.data)
				})
			axios.defaults.baseURL ="http://localhost:8090"	
			let url3="/axios/getUserById?id=100"
			/* axios.get(url3).then( result =>{
				alert(result.data)
			}) */
			
			/* async function getUserById(){
				let promise=await axios.get(url3)
					alert(promise.data)
			}
			getUserById() */
			
			async function getUserById(){
				let {data: resultData,status: code}=await axios.get(url3)
					console.log(resultData)
					console.log(code)
			}
			getUserById()
				
			
		</script>
	</body>
</html>
